package com.nsl.my_youlai.bbu_return.enums.check;

import com.nsl.my_youlai.bbu2.enums.BoardTypeEnum;
import com.nsl.my_youlai.common.base.IBaseEnum;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
public enum VendorBbuModelEnum implements IBaseEnum<Integer> {

    HW_BBU5900(0,"华为_BBU5900"),
    HW_BBU3900(1,"华为_BBU3900"),
    HW_BBU3910(2,"华为_BBU3910"),
    ZX_V9200(3,"中兴_V9200"),
    ZX_B8200(4,"中兴_B8200"),
    DT_EMB6216(5,"大唐_EMB6216");



    //华为_4g
    private String vendorBbuModel;

    private Integer id;

    private Map<BoardTypeEnum,List<Integer>> boardTypeSlotIndexMap=new HashMap<>();

     VendorBbuModelEnum(Integer id, String vendorBbuModel){
         this.id=id;
         this.vendorBbuModel = vendorBbuModel.toUpperCase();
         System.out.println(("vendorNetType = " + vendorBbuModel));
         switch (this.vendorBbuModel){
             case "中兴_B8200":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(1,2));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(3,4,5,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.SWITCH_BOARD,Arrays.asList(3,4,5,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(14,15));
                 break;
             case "中兴_V9200":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(1,2));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(3,4,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.SWITCH_BOARD,Arrays.asList(3,4,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(5,13));
                 break;
             case "华为_BBU3900", "华为_BBU3910","华为_BBU5900":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(6,7));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(0,1,2,3,4,5));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(18,19));
                 break;
             case "大唐_EMB6216":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(0,1));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(2,3,5,6,7));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(4));
                 break;
             default:
                 throw new RuntimeException(("厂家和BBU类型错误"));
         }
    }

    @Override
    public Integer getValue() {
        return this.id;
    }

    @Override
    public String getLabel() {
        return this.vendorBbuModel;
    }

    @Override
    public String getEnumCnName() {
        return "厂家BBU型号";
    }


    public Map<BoardTypeEnum,List<Integer>> getBoardTypeSlotIndexMap(){
         return this.boardTypeSlotIndexMap;
    }
}
